<?php /*a:3:{s:47:"D:\www\long_shop\app\view\acc\charge_check.html";i:1702389678;s:42:"D:\www\long_shop\app\view\common\head.html";i:1702389678;s:48:"D:\www\long_shop\app\view\common\pagination.html";i:1702389678;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/jquery/jquery-1.12.4.min.js"></script>    
    <link href="/static/bst5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/bst5.3.2/js/bootstrap.bundle.min.js"></script>
    <link rel="stylesheet" href="/static/bst-icons/font/bootstrap-icons.css">
    <script src="/static/layer/layer/layer.js"></script>
    <link rel="stylesheet" href="/static/css/my.css">    
</head>
<head>
<title>收付款审核</title>
    <style type="text/css">
        input{display:initial!important;}
    </style>    
</head>
<body >

    <div class="container-fluid " >

    <div class="row">
        <div class="col-2" style="text-align: left;line-height: 50px;font-size: 2rem;" >
            收付款审核
        </div>
        <div class="col-10">
        <form action="/index.php/acc/charge_check" method="post">
            <div class="row" id="query_bar" style="height: 50px;line-height: 50px;">
                <div class="col">

                <label for="name" >姓名：</label>
                <input class="form-control" type="text"  id="name" name="name" value="<?php echo htmlentities($name); ?>" placeholder="姓名" />
                <label for="mobile" >手机：</label>
                <input class="form-control" type="text"  id="mobile" name="mobile" value="<?php echo htmlentities($mobile); ?>" placeholder="手机号码" />
                <button type="button" class="btn btn-warning query" style="vertical-align: middle;" >
                    <span class="bi-search" ></span>
                </button>
            
                </div>

            </div>
        </form>

        </div>
    </div>

      <table class="table table-sm table-striped">
        <thead>
            <th>序号</th>
            <th>类型</th>
            <th>客户</th>
            <th>金额</th>
            <th>支付方式</th>
            <th>款项备注</th>
            <th>录入人</th>
            <th>日期</th>
            <th>状态</th>
            <th>
            </th>
        </thead>
        <tbody>
          <?php foreach($list['data'] as $k=>$log): ?>
          <tr>
            <td><?php echo htmlentities($k+1); ?></td>
            <td><?php echo htmlentities($log['type_name']); ?></td>
            <td><?php echo htmlentities($log['customer_id_name']); ?></td>
            <td style="color:<?php if($log['money']<0): ?> red;<?php endif; ?>"><?php echo htmlentities($log['money']); ?></td>
            <td><?php echo htmlentities($log['payment_name']); ?></td>            
            <td><?php echo htmlentities($log['memo']); ?></td>
            <td><?php echo htmlentities($log['creater_name']); ?></td>
            <td><?php echo htmlentities($log['create_time']); ?></td>
            <td><?php echo htmlentities($log['status_name']); ?></td>
            <td>
                <?php if($log['status']==1): ?>
                <button class="btn btn-sm btn-primary check_ok" acc_id="<?php echo htmlentities($log['id']); ?>" status="2"><span class="bi-check" title="通过"></span></button>
                <button class="btn btn-sm btn-warning check_cancel" acc_id="<?php echo htmlentities($log['id']); ?>" status="4"><span class="bi-trash" title="取消"></span></button>
                <?php endif; ?>
            </td>
          </tr>
          <?php endforeach; ?>
        </tbody>
      </table>
          <ul class="pagination pagination" >

        <?php if($list['current_page']>1): ?>
            <li class="page-item">
                <a class="page-link" href="?page=1<?php if(!empty($query)): ?><?php echo htmlentities($query); ?><?php endif; if(!empty($show_grid)): ?>&show_grid=<?php echo htmlentities($show_grid); ?><?php endif; ?>">
                    <span class="bi-chevron-double-left"></span>
                </a>
            </li>
            <li class="page-item">
                <a class="page-link" href="?page=<?php echo htmlentities($list['current_page']-1); if(!empty($query)): ?><?php echo htmlentities($query); ?><?php endif; if(!empty($show_grid)): ?>&show_grid=<?php echo htmlentities($show_grid); ?><?php endif; ?>">
                    <span class="bi-chevron-left"></span>
                </a>
            </li>
        <?php endif; ?>

        <li class="page-item">
            <c class="page-link text-secondary"><?php echo htmlentities($list['current_page']); ?>/<?php echo htmlentities($list['last_page']); ?></c>
        </li>

        <?php if($list['current_page']<$list['last_page']): ?>
            <li class="page-item">
                <a class="page-link" href="?page=<?php echo htmlentities($list['current_page']+1); if(!empty($query) && $query!=''): ?><?php echo htmlentities($query); ?><?php endif; if(!empty($show_grid)): ?>&show_grid=<?php echo htmlentities($show_grid); ?><?php endif; ?>">
                    <span class="bi-chevron-right"></span>    <!--下一页-->
                </a>
            </li>
            <li class="page-item">
                <a class="page-link" href="?page=<?php echo htmlentities($list['last_page']); if(!empty($query)): ?><?php echo htmlentities($query); ?><?php endif; if(!empty($show_grid)): ?>&show_grid=<?php echo htmlentities($show_grid); ?><?php endif; ?>">
                    <span class="bi-chevron-double-right"></span>    <!--末页-->
                </a>
            </li>
        <?php endif; ?>


      </ul>
      <br/>
      
    </div>

<script type="text/javascript">


  $(document).ready(function(){
    $(".query").on('click',function(){
        var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2

        $("form").submit();
        layer.close(index);
    }) 


    $(".check_ok,.check_cancel").on('click',function(){
            var acc_id=$(this).attr('acc_id');
            var status = $(this).attr('status');
            var msg = (status==2) ? '【收款】请确认到账情况，【付款】请确认已打款！':'是否确认取消此笔款项？';

            layer.confirm(msg, {title:'操作确认',
              btn: ['Yes','No'] //按钮
            }, function(){
                //submit order
                $.post('/index.php/acc/charge_check',{
                    id:acc_id,status:status
                },function(res){
                    var res =JSON.parse(res);
                    console.log(res.msg);
                    layer.msg(res.msg,function(){location.reload()});

                })  

            }, function(){
                // layer.msg('yes!');
                //  return false;
            });
    })
  })


  




</script>


</body>
</html>
